package cate.game.role.res.worldtree;

import cate.common.table.d.GDFunc;
import cate.game.role.FuncOpenChecker;
import cate.game.role.Role;
import cate.game.role.res.worldtree.addition.WorldTreeAddition;
import cate.game.role.res.worldtree.share.HeroShare;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass("世界之树")
public class WorldTree extends FuncOpenChecker {
    @NoteField("共享")
    public HeroShare heroShare;

    @NoteField("加成")
    public WorldTreeAddition addition;

    @Override
    public void initialize(Role role){
        super.initialize(role);
        if(heroShare == null){
            heroShare = new HeroShare();
        }
        heroShare.initialize(role);
        if (addition == null) {
            addition = new WorldTreeAddition();
        }
        addition.initialize(role);
    }

    @Override
    public int getFuncId() {
        return GDFunc.WORLD_TREE;
    }

    @Override
    public void onAfterOpen() {
        heroShare.onHeroLvlChange(false);
    }

    @Override
    public void onDaySpan(boolean silence){

    }

    @Override
    public void onEnter(){
        heroShare.onEnter();
    }
}
